package spring.DI.methodDI;

/**
 * 子类：狗
 *
 * @author ME
 * @date   2019/2/26 17:59
 */
public class Dog {

    private String name;
    private String gender;
    private Integer age;

    public Dog() {
    }

    public Dog(String name, String gender, Integer age) {
        if (null == name) {
            System.err.println("name 为空！");
        }
        this.name = name;
        this.gender = gender;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String toString() {
        return String.format("{name: %s, gender: %s, age: %d}", this.name, this.gender, this.age);
    }

    public void say() {
        System.out.println("I am a Dog...");
    }
}
